//
//  ViewController.m
//  DelegateDemo
//
//  Created by lujianing on 15/1/7.
//  Copyright (c) 2015年 lujianing. All rights reserved.
//

#import "ViewController.h"
#import "PushViewController.h"

@interface ViewController ()

@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view, typically from a nib.
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    
    PushViewController* view = segue.destinationViewController;
    if ([view respondsToSelector:@selector(setValue:)]) {
        [view setValue:self.myLabel.text forKey:@"_value"];
    }
    view.delegate=self;
}

-(void)updateLable:(NSString *)str{
    self.myLabel.text=str;
}


@end
